# encoding=utf-8
from django.db import models

class House(models.Model):
    name=models.CharField('名称',max_length=30)
    address=models.CharField('地址',max_length=80,null=True)
    town=models.CharField('城镇', choices=(('beijiao','北滘'), ('chencun','陈村')),max_length=10,null=True)
    detail=models.TextField('详细',max_length=300,null=True)
    createdate=models.DateTimeField(auto_now_add=True)
    updatedate=models.DateTimeField(auto_now=True)
    image=models.ImageField('图片',upload_to ='static',null=True)

    def __unicode__(self):
	return self.name

class Photo(models.Model):
    house=models.ForeignKey(House)
    photo=models.ImageField('图片',upload_to ='static')
    def __unicode__(self):
	return self.house.name